package com.liaoyifan.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum CoreCodeEnum implements ICodeEnum {

    /*--------------- 核心业务码 10XX ---------------*/
    UNKNOWN(1000, "{com.liaoyifan.core.enums.CoreCodeEnum.UNKNOWN.message}"),
    PARAM_ERROR(1001, "{com.liaoyifan.core.enums.CoreCodeEnum.PARAM_ERROR.message}"),
    RESOURCE_LOCKED(1002, "{com.liaoyifan.core.enums.CoreCodeEnum.RESOURCE_LOCKED.message}"),
    RATE_LIMIT_EXCEEDED(
            1003, "{com.liaoyifan.core.enums.CoreCodeEnum.RATE_LIMIT_EXCEEDED.message}"),
    REPEAT_REQUEST(1004, "{com.liaoyifan.core.enums.CoreCodeEnum.REPEAT_REQUEST.message}"),
    BLOCK_EXCEPTION(1005, "{com.liaoyifan.core.enums.CoreCodeEnum.BLOCK_EXCEPTION.message}"),
    RESOURCE_NOT_FOUND(1006, "{com.liaoyifan.core.enums.CoreCodeEnum.RESOURCE_NOT_FOUND.message}"),
    METHOD_NOT_ALLOWED(1007, "{com.liaoyifan.core.enums.CoreCodeEnum.METHOD_NOT_ALLOWED.message}"),
    ;
    private final int code;
    private final String message;

    static {
        ICodeEnum.unique(values());
    }
}
